package com.wiqer.job58;

import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.ConcurrentSkipListMap;

public class ExpectTask {
    /*版本号吗，我也忘了*/
    private String version;
    /*任务类的全路径*/
    private String className;
    /*循行的方法名*/
    private String taskName;
    //实体类
    private Object task;
    //下一个任务
    private List<ExpectTask> nextExpectTask;
    //上一个任务
    private List<ExpectTask> prevExpectTask;

    //当前任务的参数列表
    private ConcurrentSkipListMap<Integer,Object> params;
    //下下传递时，对应函数是否需要传参
    private ConcurrentSkipListMap<ExpectTask,Object> transmitParams;


    public ExpectTask(){
        nextExpectTask=new LinkedList<>();
        prevExpectTask=new LinkedList<>();
    }
    public ExpectTask setTransmitParam(ExpectTask expectTask,int i){
        nextExpectTask.add(expectTask);
        if(transmitParams==null)transmitParams=new ConcurrentSkipListMap<>();
        transmitParams.put(expectTask,i);
        return this;
    }
    public String getVersion() {
        return version;
    }

    public ExpectTask setVersion(String version) {

        this.version = version;
        return this;
    }

    public String getClassName() {
        return className;
    }

    public ExpectTask setClassName(String className) {
        this.className = className;
        return this;
    }

    public String getTaskName() {
        return taskName;
    }

    public ExpectTask setTaskName(String taskName) {
        this.taskName = taskName;
        return this;
    }

    public Object getTask() {
        return task;
    }

    public ExpectTask setTask(Object task) {
        this.task = task;
        return this;
    }

    public List<ExpectTask> getNextExpectTask() {
        return nextExpectTask;
    }

    public ExpectTask setNextExpectTask(List<ExpectTask> nextExpectTask) {
        this.nextExpectTask = nextExpectTask;
        return this;
    }

    public List<ExpectTask> getPrevExpectTask() {
        return prevExpectTask;
    }

    public ExpectTask setPrevExpectTask(List<ExpectTask> prevExpectTask) {
        this.prevExpectTask = prevExpectTask;
        return this;
    }
}
